package com.odm.communitymanage.ui.mine.MySeekHelp

import android.widget.TextView
import com.blankj.utilcode.util.ColorUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.odm.communitymanage.R
import com.odm.communitymanage.core.bean.SeekHelpData

/**
 * @description: 我的求助 适配器
 * @author: ODM
 * @date: 2020/4/18
 */
class MySeekHelpAdapter(data : MutableList<SeekHelpData>):
    BaseQuickAdapter<SeekHelpData, BaseViewHolder>(R.layout.item_my_seek_help , data){

    override fun convert(holder: BaseViewHolder, item: SeekHelpData) {

        holder.setText(R.id.tvContent_MySeekHelp ,item.content)
        holder.setText(R.id.tvTime_MySeekHelp , item.time)

        when(item.status){
            0->{
                holder.getView<TextView>(R.id.tvType_MySeekHelp).setTextColor(ColorUtils.getColor(R.color.help_unsloved))
                holder.setText(R.id.tvType_MySeekHelp , context.getString(R.string.unsloved))
            }
            1->{
                holder.getView<TextView>(R.id.tvType_MySeekHelp).setTextColor(ColorUtils.getColor(R.color.help_solved))
                holder.setText(R.id.tvType_MySeekHelp , context.getString(R.string.solved))
            }
            else->{ }
        }


    }
}